8  Week Two Overview

8.1 Week Two

8.1.1 Data Structures in R (2.1)

On completion, you should:

  • understand the five most commonly-used data structures in R

    • Matrices, arrays, lists, data frames, tibbles
  • be able to create and manipulate these data structures

  • be familiar with the ‘tibbles’ data structure

8.1.2 Control Structures and Functions (2.2)

On completion, you should:

  • understand how to create conditional statements in R

    • if, else, else if
  • understand how to create loops in R

    • for, while
  • understand how to create a custom function in R

8.1.3 Importing Data into R (2.3)

On completion, you should:

  • understand the most common formats in which data is stored

    • csv, xls, json
  • be able to import datasets in various formats into R, ready for preparation and analysis

    • readxl, tidyverse

8.1.4 Data Manipulation (2.4)

On completion, you should:

  • be confident in cleaning datasets, preparing them for analysis

    • tidyverse

    • filtering data

    • sorting data

    • creating new data

    • grouping data

  • understand how to manipulate variables, and create new variables, in preparation for analysis

    • removing outliers

    • removing missing data

    • removing specific variables

    • renaming variables

    • creating a new dataset

    • changing variable types

    • creating logical variables

    • calculating a new variable based on existing ones

8.2